<?php

namespace apiend\models;

use Yii;
use yii\data\ActiveDataProvider;
use common\helpers\ArrayHelper;

/**
 * 地区信息
 *
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class DistrictData extends \common\models\base\BaseDistrict {

    /**
     * 条件检索
     * @param array $params
     * @return ActiveDataProvider
     */
    public function search() {
        $data = static::find()->asArray()->all();
        return ArrayHelper::toTree($data, 0, 'id', 'parent_id');
    }

}
